<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class HelpAnswer extends Model
{

    protected $table = 'c_help_answers';

    /***
     * @param $param
     * @return array
     * 获取问题列表
     */
    public function getHelpAnswer($param)
    {
        $res = $this->where([['help_cate_id', '=', $param['cate_id']], ['status', '=', 1]])->get();
        if (!empty($res)) {
            return $res->toArray();
        }
        return [];
    }

    /**
     * @param $param
     * @return array
     * 获取帮助详情
     */
    public function getHelpAnswerDetail($param)
    {
        $res = $this->where([['id', '=', $param['id']]])->get();
        if (!empty($res)) {
            return $res->toArray();
        }
        return [];
    }
}
